package com.wisdom.benefit.jufa.entity;

import android.os.Parcel;
import android.os.Parcelable;

import androidx.annotation.NonNull;

/**
 * Created on 2019/05/22 11:35.
 *
 * @author zhoudawei
 */
public class VersionInfo implements Parcelable, Comparable<VersionInfo> {

    private String versionContent;
    private int versionOrder;

    public String getVersionContent() {
        return versionContent;
    }

    public int getVersionOrder() {
        return versionOrder;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.versionContent);
        dest.writeInt(this.versionOrder);
    }

    public VersionInfo() {
    }

    protected VersionInfo(Parcel in) {
        this.versionContent = in.readString();
        this.versionOrder = in.readInt();
    }

    public static final Creator<VersionInfo> CREATOR = new Creator<VersionInfo>() {
        @Override
        public VersionInfo createFromParcel(Parcel source) {
            return new VersionInfo(source);
        }

        @Override
        public VersionInfo[] newArray(int size) {
            return new VersionInfo[size];
        }
    };

    @Override
    public int compareTo(@NonNull VersionInfo o) {
        return Integer.compare(o.versionOrder, this.versionOrder) * -1;
    }
}
